package com.adminserver.service.impl;

import com.adminserver.util.DateGenerator.DateGenerator;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.adminserver.entity.ApplyMaterialEntity;
import com.adminserver.service.ApplyMaterialService;
import com.adminserver.mapper.ApplyMaterialMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author huahua
 * @description 针对表【apply_material(申报材料)】的数据库操作Service实现
 * @createDate 2022-04-24 19:22:54
 */
@Service
public class ApplyMaterialServiceImpl extends ServiceImpl<ApplyMaterialMapper, ApplyMaterialEntity> implements ApplyMaterialService {

    @Autowired
    ApplyMaterialMapper applyMaterialMapper;

    @Override
    public List<ApplyMaterialEntity> yearSpendingAndIncomeFinancial(int year) {
        String[] yearBeginEndTime = DateGenerator.getYearBeginEndTime(year);
        return applyMaterialMapper.queryMaterialPriceAndTakeAmountAndChargeOnByApplyTimeBetween(yearBeginEndTime[0], yearBeginEndTime[1]);
    }
}




